package org.eclipse.football;

import static org.junit.Assert.*;

import org.junit.Test;

public class InsertPlayer {

	@Test
	public void test() {
		// Create a team
		Team team = new Team("test","user");
		
		// Create an OffPlayer
		OffPlayer off_player = new OffPlayer("off_player", "team");
		
		// Create a DefPlayer
		DefPlayer def_player = new DefPlayer("def_player", "team");
		
		// Create a kicker
		Kicker kicker = new Kicker("kicker", "team");
		
		// Get old number of offensive players
		int old_size = team.getOff_players().size();
		
		// Try to add off_player to team
		team.addOffPlayer(off_player);
		
		// Make sure number of offensive players increased by 1
		if(team.getOff_players().size() != old_size + 1){
			// If not then fail
			fail("Could not add offensive player to team");
		}
		
		// Get old number of defensive players
		old_size = team.getDef_players().size();
		
		// Try to add def_player to team
		team.addDefPlayer(def_player);
		
		// Make sure number of defensive players increased by 1
		if(team.getDef_players().size() != old_size + 1){
			// If not then fail
			fail("Could not add defensive player to team");
		}
		
		// Get old number of kickers
		old_size = team.getKickers().size();
		
		// Try to add kicker to team
		team.addKicker(kicker);
		
		// Make sure number of kickers increased by 1
		if(team.getKickers().size() != old_size + 1){
			// If not then fail
			fail("Could not add kicker to team");
		}
	}

}
